{% extends "base.html" %}

{% block content %}

<h1>{% block inner_title %}{% endblock %}</h1> 

<div class="module" id="searchlist">
<table cellspacing="0"> 
  <thead> 
  <tr>
    {% for field in fields %}
    {% ifequal field.name order_field %}
    <th class="sorted {{ order_asc|yesno:'ascending,descending' }}">
      <a href="?{{ query_args_order }}&o={{ order_asc|yesno:'-,' }}{{ field.name|urlencode }}">{{ field.desc }}</a>
    </th>
    {% else %}
    {% if not field.name %}
    <th>{{ field.desc }}</th>
    {% else %}
    <th><a href="?{{ query_args_order }}&o={{ field.name|urlencode }}">{{ field.desc }}</a></th>
    {% endif %}
    {% endifequal %}
    {% endfor %}
  </tr>
  </thead>
  <tbody>
  {% for item in programs %}    
  <tr class="{% cycle 'row1' 'row2' %}">	
	<td><a href="{% url subjects_list school_year item.id %}">{{ item.name }}</a></td>
  </tr>
  {% empty %}
  <tr style="height: 50px;">
    <th colspan="{{ fields|length }}" style="text-align: center;"><br/>{% block no_results %}Za vašo poizvedbo ni zadetkov.{% endblock %}</th>
  </tr>
  {% endfor %}
  </tbody> 
</table>
</div>
{% endblock %}
